IF exists(SELECT * FROM dbo.sysobjects WHERE name='kalenderMetWeekdag' AND xtype='V') 
BEGIN
	DROP VIEW kalenderMetWeekdag
END
GO

create view kalenderMetWeekdag 
as
select weekdag=case when datepart(dw,datum)=2 then 'ma'
		    when datepart(dw,datum)=3 then 'di'
		    when datepart(dw,datum)=4 then 'wo'
		    when datepart(dw,datum)=5 then 'do'
		    when datepart(dw,datum)=6 then  'vr'  end,
      datum
from kalender as k